package com.ywu.bpmn.form.standard.service;

import com.ywu.bpmn.form.service.dto.YwuFormInterfaceDto;
import com.ywu.bpmn.form.service.dto.YwuFormInterfaceVersionDto;
import com.ywu.bpmn.form.service.service.YwuFormInterfaceUiService;
import com.ywu.common.result.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName YwuFormInterfaceStandardService
 * @Description TODO
 * @Author GroundDemo
 * @Date 2025/4/21 13:00
 * @Version 1.0
 **/
@Service
public class YwuFormInterfaceStandardService {
    @Autowired
    private YwuFormInterfaceUiService service;

    /**
    * @Author GroundDemo
    * @Description 创建表单外部接口
    * @Date 13:02 2025/4/21
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    public CommonResult<Object> createInterface(YwuFormInterfaceDto dto) {
        return service.createInterface(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 修改表单外部接口
    * @Date 13:02 2025/4/21
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    public CommonResult<Object> updateInterface(YwuFormInterfaceDto dto) {
        return service.updateInterface(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 删除表单外部接口
    * @Date 13:03 2025/4/21
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    public CommonResult<Object> deleteInterface(YwuFormInterfaceDto dto) {
        return service.deleteInterface(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 分页查询表单外部接口
    * @Date 13:04 2025/4/21
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    public CommonResult<Object> queryInterfacePageList(YwuFormInterfaceDto dto) {
        return service.queryPageList(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 发布表单外部接口
    * @Date 13:04 2025/4/21
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    public CommonResult<Object> publishInterface(YwuFormInterfaceDto dto) {
        return service.publishInterface(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 查询历史版本列表
    * @Date 13:05 2025/4/21
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    public CommonResult<Object> queryVersionList(YwuFormInterfaceDto dto) {
        return service.queryInterfaceVersionList(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 删除草稿版本
    * @Date 13:06 2025/4/21
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    public CommonResult<Object> deleteVersion(YwuFormInterfaceVersionDto dto) {
        return service.deleteVersion(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 回退历史版本
    * @Date 13:06 2025/4/21
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    public CommonResult<Object> backVersion(YwuFormInterfaceVersionDto dto) {
        return service.backVersion(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 执行外部接口
    * @Date 17:44 2025/4/21
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    public CommonResult<Object> execInterfaceByVersion(YwuFormInterfaceVersionDto dto) {
        return service.execFormHandlerByVersion(dto);
    }
}
